#include <algorithm>
#include <bitset>
#include <cstdint>
#include <cstdio>
#include <iostream>
#include <istream>
#include <print>
#include <vector>

using ll = int64_t;

const ll maxa=5e6+5;
std::vector<ll> t;
std::bitset<maxa> isp;

static inline void solve(){
    ll n;
    std::cin>>n;
    // a.clear();
    // a.resize(n+1);
    ll minn = 1e9+7;
    ll a=-1;
    for(ll i=1;i<=n;i++){
        ll tmp;
        std::cin>>tmp;
        if(t[tmp]<minn){
            minn=t[tmp];
            a=tmp;
        }
    }
    if(!(a%4)){
        std::cout<<"Farmer Nhoj\n";
    }else{
        std::cout<<"Farmer John\n";
    }
}

int main(){
    std::iostream::sync_with_stdio(false);
    std::cin.tie(nullptr);

    isp.set();
    for(ll i=2;i<isp.size();i++){
        if(!isp[i])continue;
        for(ll j=2;i*j<isp.size();j++){
            isp[i*j]=false;
        }
    }
    // for(ll i=1;i<=100;i++)if(isp[i])std::cout<<i<<"\n";
    t.resize(maxa);
    for(ll i=1;i<t.size();i++){
        if((i&1)==0){
            t[i]=i/4;
            continue;
        }
        ll nt=0,ni=i;
        while(ni>=4){
            if(isp[ni]){
                t[i]=nt;
                break;
            }
            nt++;
            ni-=4;
        }
        // printf("t[%lld]=%lld\n",i,t[i]);
    }
    // for(ll i=1;i<=100;i++)printf("t[%lld]=%lld\n",i,t[i]);
    ll T;
    std::cin>>T;
    while(T--){
        solve();
    }
}